<extend name="Public/base"/>

<block name="body">
    <!-- 标题栏 -->
    <div class="main-title">
        <h2>{$title}</h2>
    </div>
    <!-- 数据列表 -->
    <div class="data">
        <table class="">
            <thead>
            <tr>
                <th class="public_tanle_qianmian">一级菜单名</th>
                <th class="public_tanle_qianmian">是否必选</th>
                <th class="public_content_lost1">操作</th>
            </tr>
            </thead>
            <tbody>
                <tr>
                    <td class="public_content_qianmian" width="60%">{$pre1.name|default='--'}</td>
                    <td class="public_content_qianmian">是</td>
                    <td class="public_content_lost1 public_content_jl" style="text-align:center;width: 140px;">
                        <p><a href="{:U('one_func_edit?id='.$pre1['id'])}" class="reward_pass">编辑</a></p>
                        <p><a href="{:U('one_func_pre_choice?id='.$pre1['id'])}" class="reward_pass">洗涤必备默认</a></p>
                    </td>
                </tr>
                <tr>
                    <td class="public_content_qianmian">{$pre2.name|default='--'}</td>
                    <td class="public_content_qianmian">否</td>
                    <td class="public_content_lost1 public_content_jl" style="text-align:center;width: 140px;">
                        <p><a href="{:U('one_func_edit?id='.$pre2['id'])}" class="reward_pass">编辑</a></p>
                    </td>
                </tr>
            </tbody>
        </table>
    </div>

    <!-- 按钮工具栏 -->
    <div class="cf" style="padding-top: 70px">
        <h3>一级菜单：{$pre1.name|default='--'}</h3>
        <a class="btn fr fh_dis" href="{:U('two_func_add?meta_title='.$pre1['name'].'&id='.$pre1['id'])}" style="margin: 0px">新增</a>
    </div>
    <!-- 数据列表 -->
    <div class="data">
        <table class="">
            <thead>
            <tr>
                <th class="public_tanle_qianmian">二级菜单名</th>
                <th class="public_tanle_qianmian">图片</th>
                <th class="public_tanle_qianmian">洗涤必备是否优先</th>
                <th class="public_content_lost1">操作</th>
            </tr>
            </thead>
            <tbody>
            <notempty name="wash">
                <volist name="wash" id="wash_vo">
                    <tr>
                        <td class="public_content_qianmian">{$wash_vo.name|default='--'}</td>
                        <td class="public_content_qianmian" width="18%"><img src="{$wash_vo.img_url}" style="height: auto;" /></td>
                        <if condition='$wash_vo.p_first eq 1'>
                            <td class="public_content_qianmian" style="width: 8%">是</td>
                        <else />
                            <td class="public_content_qianmian" style="width: 8%">否</td>
                        </if>
                        <td class="public_content_lost1 public_content_jl" style="text-align:center;width: 140px;">
                            <p><a href="{:U('two_func_edit?id='.$wash_vo['id'])}" class="reward_pass">编辑</a></p>
                            <p><a href="{:U('two_func_del?id='.$wash_vo['id'])}" class="del">删除</a></p>
                            <p><a href="{:U('two_func_pre_choice?id='.$wash_vo['id'])}" class="reward_pass">洗涤必备优先</a></p>
                            <p><a href="{:U('two_func_wash_choice?id='.$wash_vo['id'])}" class="reward_pass">洗涤搭配选择</a></p>
                        </td>
                    </tr>
                </volist>
                <else/>
                <td colspan="100" class="text-center"> 暂时没有内容 </td>
            </notempty>
            </tbody>
        </table>
    </div>

    <!-- 按钮工具栏 -->
    <div class="cf" style="padding-top: 70px">
        <h3>一级菜单：{$pre2.name|default='--'}</h3>
        <a class="btn fr fh_dis" href="{:U('two_func_add?meta_title='.$pre2['name'].'&id='.$pre2['id'])}" style="margin: 0px">新增</a>
    </div>
    <!-- 数据列表 -->
    <div class="data">
        <table class="">
            <thead>
            <tr>
                <th class="public_tanle_qianmian">二级菜单名</th>
                <th class="public_tanle_qianmian">图片</th>
                <th class="public_content_lost1">操作</th>
            </tr>
            </thead>
            <tbody>
            <notempty name="dirt">
                <volist name="dirt" id="dirt_vo">
                    <tr>
                        <td class="public_content_qianmian" width="60%">{$dirt_vo.name|default='--'}</td>
                        <td class="public_content_qianmian"><img src="{$dirt_vo.img_url}" style="height: auto;" /></td>
                        <td class="public_content_lost1 public_content_jl" style="text-align:center;width: 140px;">
                            <p><a href="{:U('two_func_edit?id='.$dirt_vo['id'])}" class="reward_pass">编辑</a></p>
                            <p><a href="{:U('two_func_del?id='.$dirt_vo['id'])}" class="del">删除</a></p>
                            <p><a href="{:U('two_func_dirt_choice?id='.$dirt_vo['id'])}" class="reward_pass">去污必备选择</a></p>
                        </td>
                    </tr>
                </volist>
                <else/>
                <td colspan="100" class="text-center"> 暂时没有内容 </td>
            </notempty>
            </tbody>
        </table>
    </div>
</block>

<block name="script">
    <link href="__STATIC__/datetimepicker/css/datetimepicker.css" rel="stylesheet" type="text/css">
    <php>if(C('COLOR_STYLE')=='blue_color') echo '<link href="__STATIC__/datetimepicker/css/datetimepicker_blue.css" rel="stylesheet" type="text/css">';</php>
    <link href="__STATIC__/datetimepicker/css/dropdown.css" rel="stylesheet" type="text/css">
    <script type="text/javascript" src="__STATIC__/datetimepicker/js/bootstrap-datetimepicker.min.js"></script>
    <script type="text/javascript" src="__STATIC__/datetimepicker/js/locales/bootstrap-datetimepicker.zh-CN.js" charset="UTF-8"></script>
    <!-- 引入CSS、JS开始 -->
    <link href="__CSS__/wash_helper/gm_table_public.css" rel="stylesheet" type="text/css">
    <!-- 引入CSS、JS结束 -->
    <script type="text/javascript">
        $(function () {
            /* 无刷新删除 */
            $('.del').click(function(){
                var target;
                var that = this;

                if(!confirm('删除将不可恢复，确认删除吗？')){
                    return false;
                }

                target = $(this).attr('href');
                $.get(target).success(function(data){
                    if (data.status==1) {
                        if (data.url) {
                            updateAlert(data.info + ' 页面即将自动跳转~','alert-success');
                        }else{
                            updateAlert(data.info,'alert-success');
                        }
                        setTimeout(function(){
                            if (data.url) {
                                location.href=data.url;
                            }else if( $(that).hasClass('no-refresh')){
                                $('#top-alert').find('button').click();
                            }else{
                                location.reload();
                            }
                        },1500);
                    }else{
                        updateAlert(data.info);
                        setTimeout(function(){
                            if (data.url) {
                                location.href=data.url;
                            }else{
                                $('#top-alert').find('button').click();
                            }
                        },1500);
                    }
                });
                return false;
            });
        })
    </script>
</block>